puts("Test Basic Types")
let num = 1 + (4 * 5) / 2;
let str = "This is a string."
let boolean = true;

puts("Test if Expression")
let result = if (num == 11) {
    "Yes, num is 11";
} else {
    "No, num is not 11";
}
puts("Get result = " + result)

puts("Test String equality")
puts("Abc" == "Abc")
puts("ABC" != "ABC")

puts("Test Functions")
let add = fn(x, y) {
    return x + y;
}
puts(add(1+3, 2-4))
puts(add("Also support any type that ", "support '+' operator"))

puts("Test Arrays")
let arr = [1, 1 + 1, 2 * 2 - 1];
put(arr[0], arr[1], arr[2], arr[-1])

puts("Test Hash Tables")
let hash = {
    "str": "Only String, " ,
    1 + 1: "Integers, ",
    true: "and Boolean"
}
put(hash["str"], hash[2], hash[true], "can be used as keys.")

puts("Test Closures")
let adderMaker = fn(x) {
    return fn(y) {
        return x + y;
    };
}
let add2 = adderMaker(2);
put(add2(3), " is 5");

puts("Test builtin Functions")
puts(len("abc"), len([1, 2, 3]))
puts(arr)
put("first(arr) = ", first(arr))
put("last(arr) = ", last(arr))
put("rest(arr) = ", rest(arr))
put("push(arr, 4) = ", push(arr, 4))
